package com.cooge.collection.deal;

import java.util.List;

import com.cooge.collection.pojo.CollectionUrl;
import com.cooge.collection.pojo.Episode;
import com.cooge.collection.pojo.EpisodeVideo;
import com.cooge.collection.pojo.MenuEpisode;
import com.cooge.collection.pojo.Video;
import com.cooge.collection.service.CollectionUrlService;
import com.cooge.collection.service.EpisodeService;
import com.cooge.collection.service.EpisodeVideoService;
import com.cooge.collection.service.MenuEpisodeService;
import com.cooge.collection.service.VideoService;
import com.cooge.collection.util.DataFactory;

public class Control {
	
	private static CollectionUrlService  collectionUrlService = (CollectionUrlService) DataFactory.getFactory(CollectionUrlService.class);
	
	private static VideoService  videoService = (VideoService) DataFactory.getFactory(VideoService.class);
	
	private static EpisodeService  episodeService = (EpisodeService) DataFactory.getFactory(EpisodeService.class);
	
	private static MenuEpisodeService menuEpisodeService = (MenuEpisodeService)DataFactory.getFactory(MenuEpisodeService.class);
	
	private static EpisodeVideoService episodeVideoService = (EpisodeVideoService)DataFactory.getFactory(EpisodeVideoService.class);
	
	
	public static Video saveVideo(Video video){
		
		return videoService.add(video);
	}
  public static Episode saveEpisode(Episode episode){
		
	  return episodeService.add(episode);
	}
	public static CollectionUrl saveCollectionUrl(CollectionUrl collectionUrl){
		
		return collectionUrlService.add(collectionUrl);
	}
	
	public static List<CollectionUrl> getList(){
		
		return collectionUrlService.findList();
		
	}
	public static Episode getEpisode(Long id){
		
		return episodeService.getById(id);
	}
	public static List<Episode> getEpisodeList(Episode episode){
		
		return episodeService.getByList(episode);
		
	}
	public static  MenuEpisode save(MenuEpisode  menuEpisode){
		
		return menuEpisodeService.save(menuEpisode);
	}
	public static EpisodeVideo save(EpisodeVideo episodeVideo){
		return episodeVideoService.save(episodeVideo);
		
	}


}
